/*
 * v1.1 by tonydon site:txdnet.cn
 * netbeansIDE 7.1
 */
package cn.txdnet.txcms.domain;

import cn.txdnet.txweb.annotation.validation.*;

/**
 *
 * @author txdnet
 */

public class Feedback  extends BaseEntity{
    private static final long serialVersionUID = 3199151942174184877L;
 
    private Integer msgid;

    @NotEmpty
    @Match(Match.RegexType.NICK)
    private String nick;

    @Match(Match.RegexType.TEL)
    @Default("none.")
    private String tel;
    
    @Size(min=1,max=4)
    private String sex;

    @NotEmpty
    @Size(min=0,max=64)
    @Match(Match.RegexType.EMAIL)
    private String email;
    
    @ClearXss
    @Size(min=1,max=32)
    private String cityarea;

    @ClearXss
    @Size(min=1,max=32)
    private String title;

    @ClearXss
    @Size(min=1,max=800)
    private String msg;

    @CurrTime
    private Long postime;

    private String ip;

    private Byte dealstate;

    public Feedback() {
    }

    public Integer getMsgid() {
        return msgid;
    }

    public void setMsgid(Integer msgid) {
        this.msgid = msgid;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Long getPostime() {
        return postime;
    }

    public void setPostime(Long postime) {
        this.postime = postime;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Byte getDealstate() {
        return dealstate;
    }

    public void setDealstate(Byte dealstate) {
        this.dealstate = dealstate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (msgid != null ? msgid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Feedback)) {
            return false;
        }
        Feedback other = (Feedback) object;
        if ((this.msgid == null && other.msgid != null) || (this.msgid != null && !this.msgid.equals(other.msgid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cn.txdnet.txcms.domain.Feedback[ msgid=" + msgid + " ]";
    }

    /**
     * @return the sex
     */
    public String getSex() {
        return sex;
    }

    /**
     * @param sex the sex to set
     */
    public void setSex(String sex) {
        this.sex = sex;
    }

    /**
     * @return the cityarea
     */
    public String getCityarea() {
        return cityarea;
    }

    /**
     * @param cityarea the cityarea to set
     */
    public void setCityarea(String cityarea) {
        this.cityarea = cityarea;
    }

    @Override
    public boolean validate() {
       return Validator.validate(this);
    }
    
}
